package com.erpanderp.wam.ac.model.entity.travel;

import java.util.Date;

import com.erpanderp.wam.adm.model.entity.Module;
import com.erpanderp.wam.adm.model.entity.Service;

public class TravelExpenseAmount implements Comparable<TravelExpenseAmount>{
	private Long travelExpenseAmountId;
	private TravelRequest travelRequest;
	
	private Float amount;
	private String currency;
	private String amountType; //eg: ADVANCE, APPROVAL TOTAL etc.
	
	private Date createDate;
	private Date dateModified;
	private String createdBy;
	private String modifiedBy;
	private String description;
	private String status;
	
	public Long getTravelExpenseAmountId() {
		return travelExpenseAmountId;
	}
	public void setTravelExpenseAmountId(Long travelExpenseAmountId) {
		this.travelExpenseAmountId = travelExpenseAmountId;
	}
	public TravelRequest getTravelRequest() {
		return travelRequest;
	}
	public void setTravelRequest(TravelRequest travelRequest) {
		this.travelRequest = travelRequest;
	}
	public Float getAmount() {
		return amount;
	}
	public void setAmount(Float amount) {
		this.amount = amount;
	}
	public String getCurrency() {
		return currency;
	}
	public void setCurrency(String currency) {
		this.currency = currency;
	}
	public String getAmountType() {
		return amountType;
	}
	public void setAmountType(String amountType) {
		this.amountType = amountType;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Date getDateModified() {
		return dateModified;
	}
	public void setDateModified(Date dateModified) {
		this.dateModified = dateModified;
	}
	public String getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}
	public String getModifiedBy() {
		return modifiedBy;
	}
	public void setModifiedBy(String modifiedBy) {
		this.modifiedBy = modifiedBy;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}

	public boolean equals(Object obj){
		if(this == obj){
			return true;
		}	
		if(this.travelRequest.getTravelRequestId().equals(((TravelExpenseAmount)obj).getTravelRequest().getTravelRequestId())
				&& this.getAmountType().equals(((TravelExpenseAmount)obj).getAmountType())
				&& this.getCurrency().equals(((TravelExpenseAmount)obj).getCurrency())){
			return true;
		}
		return false;
	}
	
	@Override
	public int compareTo(TravelExpenseAmount o) {
		return getCurrency().compareTo(o.getCurrency());
	}
}
